#pragma once

#include "Property/EditorPropertyViewModel.h"
#include "EditorMeshMaterialPropertyModel.h"
#include "EditorMeshMaterialPropertyViewModel.m.h"

class RTexture2D;
class REditorCPropertyViewModel;

RCLASS()
class REditorMeshMaterialPropertyViewModel : public REditorPropertyViewModel
{
    ROBJECT

public:
    virtual void BindModel(TSharedObjectPtr<REditorPropertyModel> InModel
        ,TSharedObjectPtr<REditorObjectPropertyAbilityViewModel> InAbilityViewModel) override;

    int64_t GetMaterialSlotNum();
    TSharedObjectPtr<RTexture2D> GetMaterialThumbnail(int64_t InIndex);
    CString GetMaterialName(int64_t InIndex);

protected:
    TWeakObjectPtr<REditorMeshMaterialPropertyModel> StaticMeshModel;

public:
    int64_t GetPopupMenuHeight() const  { return 400; }
    int64_t GetPopupMenuWidth() const  { return 200; }

    void SelectAsset(TSharedObjectPtr<RMaterial> InMaterial,int64_t InMaterialSlotIndex);

};